JunXiaoGuide={}
--JunXiaoGuideFunc={}
--JunXiaoGuideFunc.__index = JunXiaoGuideFunc
--setmetatable(JunXiaoGuide, JunXiaoGuideFunc)
JunXiaoGuide.state=-1
JunXiaoGuide.showJunXiao = function(self)
  setTouchEnabledAll(MainScene.node, false)
  MainScene.addMask(1002)
  setTouchEnabledAll(MainScene.getBuilding(1002), true)
end
JunXiaoGuide.refreshGeneral = function(self)
  print("JunXiaoGuide.refreshGeneral")
  setTouchEnabledAll(JunXiaoScene.instance.node, false)
  local b = TypeCast(JLSLLayer.instance.node:getChildByTag(1020), "CCButton")
  b:setEnabled(true)
  --b:setTitle("hello")
  print("JunXiaoGuide.refreshGeneral", b, JLSLLayer.instance, JLSLLayer.instance.node)
end
JunXiaoGuide.shouluGeneral = function(self)
  setTouchEnabledAll(JunXiaoScene.instance.node, false)
  TypeCast(JLSLLayer.instance.shouluButtons[1], "CCButton"):setEnabled(true)
end
JunXiaoGuide.changeTab = function(self)
  setTouchEnabledAll(JunXiaoScene.instance.node, false)
  JunXiaoScene.instance.radioMenu:setMenuItemEnabled(-1, false)
  JunXiaoScene.instance.radioMenu:setMenuItemEnabled(0, true)
  JunXiaoScene.instance.radioMenu:setMenuItemEnabled(1, true)
end
JunXiaoGuide.zhaomuGeneral = function(self)
  setTouchEnabledAll(JunXiaoScene.instance.node, false)
  TypeCast(JLZMLayer.instance.buttons[1], "CCButton"):setEnabled(true)
  --[[TypeCast(JLZMLayer.instance.buttons[#JLZMLayer.instance.buttons], "CCButton"):setEnabled(true)
  for k,v in ipairs(JLZMLayer.instance.buttons) do
    TypeCast(v, "CCButton"):setEnabled(true)
  end
  ]]
end
JunXiaoGuide.close = function(self)
  setTouchEnabledAll(JunXiaoScene.instance.node, false)
  TypeCast(JunXiaoScene.instance.node:getChildByTag(1111), "CCButton"):setEnabled(true)
end
JunXiaoGuide.nextStep = function(self)
  print("JunXiaoGuide.nextStep", JunXiaoGuide.state)
  if JunXiaoGuide.state==-1 then
    JunXiaoGuide.showJunXiao()    
    JunXiaoGuide.state=0
  elseif JunXiaoGuide.state==0 then
    JunXiaoGuide.refreshGeneral()
    JunXiaoGuide.state=1
  elseif JunXiaoGuide.state==1 then
    JunXiaoGuide.shouluGeneral() 
    JunXiaoGuide.state=2
  elseif JunXiaoGuide.state==2 then
    JunXiaoGuide.changeTab() 
    JunXiaoGuide.state=3
  elseif JunXiaoGuide.state==3 then
    JunXiaoGuide.zhaomuGeneral() 
    JunXiaoGuide.state=4
  elseif JunXiaoGuide.state==4 then
    JunXiaoGuide.close() 
    JunXiaoGuide.state=5
  end
end
